#ifndef __PLAYER_H__
#define __PLAYER_H__

#include <string>
#include <iostream>

class Player
{
protected:
    std::string name;
public:
    Player(std::string name): name(name) {}
    virtual void Attack() = 0;
    virtual void Defense() = 0;
};

class Forward: public Player
{
public:
    Forward(std::string name): Player(name) {}
    void Attack() override
    {
        std::cout << "前锋 " << name << " 进攻" << std::endl;
    }
    void Defense() override
    {
        std::cout << "前锋 " << name << " 防守" << std::endl;
    }
};

class ForeignCenter
{
    std::string name;
public:
    ForeignCenter(std::string name): name(name) {}
    void Jingong()
    {
        std::cout << "外籍中锋 " << name << " 进攻" << std::endl;
    }
    void FangShou()
    {
        std::cout << "外籍中锋 " << name << " 防守" << std::endl;
    }
};

class Guard: public Player
{
public:
    Guard(std::string name): Player(name) {}
    void Attack() override
    {
        std::cout << "后卫 " << name << " 进攻" << std::endl;
    }
    void Defense() override
    {
        std::cout << "后卫 " << name << " 防守" << std::endl;
    }
};

class Translator: public Player
{
    ForeignCenter *centor = nullptr;
public:
    Translator(std::string name): Player(name)
    {
        centor = new ForeignCenter(name);
    }
    void Attack() override
    {
        centor->Jingong();
    }
    void Defense() override
    {
        centor->FangShou();
    }
};

#endif